package com.wangshuo.config;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class Knife4jConfiguration {

    @Bean
    public OpenAPI openAPI() {
        return new OpenAPI()
                .info(new Info()
                        .title("权限项目API")
                        .version("1.0")
                        .description("权限项目的接口文档"));
    }

    @Bean
    public GroupedOpenApi userAPI() {
        return GroupedOpenApi.builder().group("管理员接口").
                pathsToMatch("/admin/**").
                build();
    }
    @Bean
    public GroupedOpenApi indexAPI() {
        return GroupedOpenApi.builder().group("角色测试接口").
                pathsToMatch("/test/**").
                build();
    }
    @Bean
    public GroupedOpenApi menuAPI() {
        return GroupedOpenApi.builder().group("菜单信息接口").
                pathsToMatch("/menu/**").
                build();
    }
    @Bean
    public GroupedOpenApi hotaluserAPI() {
        return GroupedOpenApi.builder().group("用户信息接口").
                pathsToMatch("/user/**").
                build();
    }


}
